package com.tencent.sr.iris.basic.saas.service.model.advisor;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.tencent.sr.iris.activity.interfaces.response.group.AdvisorBoardRankSecondResponse;
import com.tencent.sr.iris.basic.saas.common.enums.IrisAuditStatusEnum;
import com.tencent.sr.iris.basic.saas.common.utils.CommonUtils;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;

@Data
@ApiModel(value = "团长任务列表-排行榜导出信息(导师视角)")
@Slf4j
@ColumnWidth(15)
public class AdvisorBoardRankExportInfo {
    @ExcelProperty(value = "序号", index = 0)
    private int num;

    @ExcelProperty(value = "实时排名", index = 1)
    private Integer rankNum;

    @ExcelProperty(value = "排名阶段", index = 2)
    private String rankRang;

    @ExcelProperty(value = "团长uid", index = 3)
    private String irisUid;

    @ExcelProperty(value = "union ID", index = 4)
    private String wechatUserUnionid;

    @ExcelProperty(value = "昵称", index = 5)
    private String wechatUserNickname;

    @ExcelProperty(value = "等级", index = 6)
    private String irisUidLevel;

    @ExcelProperty(value = "有效销售额", index = 7)
    private Double validGmv;

    @ExcelProperty(value = "有效订单量", index = 8)
    private Integer validOrderNum;

    @ExcelProperty(value = "佣金金额", index = 9)
    private Double validCommissionBillCommissionFee;

    @ExcelProperty(value = "预估奖励金", index = 10)
    private Double predictAwardAmount;

    @ExcelProperty(value = "实际奖励金", index = 11)
    private Double awardAmount;

    @ExcelProperty(value = "任务状态", index = 12)
    private String auditStatus;

    public void readFromSearchResponseData(AdvisorBoardRankSecondResponse response) {
        this.setRankNum(response.getRankNum());
        this.setRankRang(response.getRankRang());
        this.setIrisUid(response.getIrisUid());
        this.setWechatUserUnionid(response.getWechatUserUnionid());
        this.setWechatUserNickname(response.getWechatUserNickname());
        this.setIrisUidLevel(response.getIrisUidLevel());
        this.setValidGmv(CommonUtils.longToDouble(response.getValidGmv()));
        this.setValidOrderNum(response.getValidOrderNum());
        this.setValidCommissionBillCommissionFee(CommonUtils.longToDouble(
                response.getValidCommissionBillCommissionFee()));
        this.setPredictAwardAmount(CommonUtils.longToDouble(response.getPredictAwardAmount()));
        this.setAwardAmount(CommonUtils.longToDouble(response.getAwardAmount()));
        this.setAuditStatus(IrisAuditStatusEnum.getByStatus(response.getAuditStatus()));
    }
}
